package com.bp.hearthealth.pulse.lnapps.bp_ui.bp_fragment.bp_tracker.bp_bean

import androidx.recyclerview.widget.DiffUtil
import com.bp.hearthealth.pulse.lnapps.bp_db.bp_bloodpressure.BloodPressureData

/**
 * 刷新局部item
 */
class BpBloodPressureDiffCallback(private val oldList: List<BloodPressureData>, private val newList: List<BloodPressureData>) : DiffUtil.Callback() {
    override fun getOldListSize(): Int {
        return oldList.size
    }

    override fun getNewListSize(): Int {
        return newList.size
    }

    override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return oldList[oldItemPosition].id == newList[newItemPosition].id
    }

    override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean {
        return oldList[oldItemPosition] == newList[newItemPosition]
    }
}
